package com.ruoyi.common.enums;

import lombok.Getter;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

@Getter
public enum ListTypeNameEnum{
    LIST_CONSTRUCTION("施工清单"),
    LIST_DEVISE("设计清单"),
    LIST_MAINTENANCE("养护清单"),
    LIST_MANAGE("管理清单");

    private static final Map<String, ListTypeNameEnum> NAME_MAP = new HashMap<>();
    private String displayName;

    static {
        for (ListTypeNameEnum listTypeNameEnum : EnumSet.allOf(ListTypeNameEnum.class)) {
            NAME_MAP.put(listTypeNameEnum.displayName, listTypeNameEnum);
        }
    }

    ListTypeNameEnum(String displayName) {
        this.displayName = displayName;
    }

    public String getDisplayName() {
        return displayName;
    }

    public static String getName(String displayName) {
        ListTypeNameEnum enumValue = NAME_MAP.get(displayName);
        return (enumValue != null) ? enumValue.name() : null;
    }
}
